library HidePassive initializer Init

globals
	private integer array passives
	private integer index = 0
endglobals

function AddHidePassive takes integer passive returns nothing
	set passives[index] = passive
	set index = index + 1
endfunction

private function Work takes nothing returns boolean
	local integer i
	local integer j
	local player p
	set i = 0
	loop
		exitwhen i == bj_MAX_PLAYER_SLOTS
		set p = Player(i)
		set j = 0
		loop
			exitwhen j == index
			call SetPlayerAbilityAvailable(p, passives[j], false)
			set j = j + 1
		endloop
		set i = i + 1
	endloop
	call DestroyTrigger(GetTriggeringTrigger())
	return false
endfunction

private function Init takes nothing returns nothing
	local trigger t = CreateTrigger()
    call TriggerAddCondition(t, Filter(function Work))
    call TriggerRegisterTimerEventSingle(t, 0)
    set t = null
endfunction

endlibrary